<template>
<div>
    <ul>
        <li v-for="(item,index) in arr" :key="index">
            <span>{{item}}</span>
            <button @click="delFn">删除</button>
        </li>
    </ul>
    <button @click="addFn">生成</button>
</div>
</template>

<script>
export default {
    data () {
        return {
            arr:[1,5,3],
        }
    },
    methods: {
        delFn(){
            this.arr.shift()
        },
        addFn(){
            this.arr.push(Math.ceil(Math.random()*100))
        }
    }
}
</script>

<style>

</style>